
package com.market.dao;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.market.bean.Orders;
import com.market.dao.hibernate.GenericDaoHibernate;

/**
 * Data access object (DAO) for domain model class Orders.
 * 
 * @see com.market.bean.Orders
 * @author MyEclipse - Hibernate Tools
 */
public class OrdersDAO extends GenericDaoHibernate<Orders, Long> implements IOrdersDAO
{

    public OrdersDAO(Class<Orders> persistentClass)
    {
        super(persistentClass);
        // TODO Auto-generated constructor stub
    }

    public OrdersDAO()
    {
        super();
    }
    
    private static final Logger log = LoggerFactory.getLogger(OrdersDAO.class);

    // property constants
    public static final String PAY = "pay";

    public static final String ISPROCESSED = "isprocessed";

    public static final String CONSIGNEE = "consignee";

    public static final String ADDRESS = "address";

    public static final String ZIP = "zip";

    public static final String TEL = "tel";

    public static final String FAX = "fax";

    public static final String EMAIL = "email";

    public static final String PROCESSOR = "processor";

    public static final String DESCRIPTION = "description";

    protected void initDao()
    {
        // do nothing
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.market.dao.IOrdersDAO#findById(java.lang.Long)
     */
    public Orders findById(long id)
    {
        log.debug("getting Orders instance with id: " + id);
        try
        {
            Orders instance = (Orders)getHibernateTemplate().get("com.market.bean.Orders", new Long(id));
            return instance;
        }
        catch (RuntimeException re)
        {
            log.error("get failed", re);
            throw re;
        }
    }
}
